<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/comm/common.jsp" %>

<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="<%=path %>/css/pintuer.css">
<link rel="stylesheet" href="<%=path %>/css/admin.css">
<script src="<%=path %>/js/jquery.js"></script>
<script src="<%=path %>/js/pintuer.js"></script>
</head>
<body><div class="panel admin-panel">
  <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>编辑角色</strong></div>
  <div class="body-content">
    <form method="post" class="form-x" action="<%=path%>/role/Role_edit.action">  
      <div class="form-group">
        <div class="label">
          <label>角色编号：</label>
        </div>
        <div class="field">
          <input type="hidden" value="${role.id}" name="roleForm.id" />
          <input type="text" class="input w50" value="${role.roleid}" name="roleForm.roleid" data-validate="required:请输入角色编号" />
          <div class="tips"></div>
        </div>
      </div>
        <div class="form-group">
        <div class="label">
          <label>角色名称：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="${role.rolename}" name="roleForm.rolename" data-validate="required:请输入角色名称" />
          <div class="tips"></div>
        </div>
      </div>
        <div class="form-group">
        <div class="label">
          <label>角色权限：</label>
        </div>
        <div class="field" >
        <s:checkboxlist name="beans" list="menuList" listKey="id" listValue="menuname" onclick="aad()"/>
        </div>
      </div>  
      <input type="hidden" id="menuListId" name="roleForm.menulistid" value="${role.menulistid}">  
          <div class="form-group">
        <div class="label">
          <label>角色说明：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="${role.remark}" name="roleForm.remark" data-validate="required:请输入角色说明" />
          <div class="tips"></div>
        </div>
      </div> 

      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>
        </div>
      </div>
    </form>
  </div>
</div>
<script type="text/javascript">
function aad(){
obj = document.getElementsByName("beans");
    check_val = [];
    for(k in obj){
        if(obj[k].checked)
            check_val.push(obj[k].value);
    }
    $("#menuListId").val(check_val);
}
</script>
</body>
</html>
